home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-02-07 | 8.0 KB | 215 lines | [TEXT/MPS ] |
- UNIT UGlobals;
-
-
- {-------------------------------------------------------------------------------
- #
- # Apple Macintosh Developer Technical Support
- #
- # Interfaces for the application utilities
- #
- # Program: ProcDoggie
- # File: UGlobals.p - Pascal Implementation
- #
- # by: Forrest Tanaka
- #
- # Copyright © 1988-1991 Apple Computer, Inc.
- # All rights reserved.
- #
- --------------------------------------------------------------------------------
- #
- # This unit contains declarations and routines that didn’t seem to fit into any
- # other unit in this application.
- #
- -------------------------------------------------------------------------------}
-
-
- INTERFACE
-
-
- (*******************************************************************************
- * Used Units
- *******************************************************************************)
-
- USES
- (* Group 1 *)
- Types
- ,QuickDraw
-
- (* Group 2 *)
- ,Controls
- ,Errors
- ,Events
- ,Files
- ,GestaltEqu
- ,Memory
- ,Resources
- ,TextEdit
- ,ToolUtils
-
- (* Group 3 *)
- ,Notification
- ,OSEvents
- ,Processes
- ,Windows
-
- (* Group 4 *)
- ,Dialogs
-
- (* Application *)
- ,UEmergMem
- ;
-
-
- (*******************************************************************************
- * Constants
- *******************************************************************************)
-
- CONST
- rMemErrMessages = 1000; {Resource ID of memory error message STR#}
- kMemErrAppOpenMsg = 1; {Not enough memory to open application}
- kMemErrProcListOpenMsg = 2; {Not enough mem to open process list wind}
- kMemErrLowMemWarnMsg = 3; {Free memory is low; proceed with caution}
- kMemErrProcInfoOpenMsg = 4; {Not enough mem to open process info wind}
-
- rResErrMessages = 1001; {Resource ID of resource error message STR#}
- kResErrAppDamageMsg = 1; {Application is damaged}
-
- rMiscErrMessages = 1002; {Resource ID of misc. error message STR#}
- kMiscErrUnknownMsg = 1; {Unknown error}
-
- rMiscWrnMessages = 2000; {Resource ID of misc. warning message STR#}
- kMiscWrnUncleanMsg = 1; {Application not 32-bit clean warning}
- kMiscWrnLaunchMemMsg = 2; {Not enough memory to launch}
-
- kMaxSleepTime = 60; {Max WNE sleep time in ticks, 1 second in this case}
-
-
- (*******************************************************************************
- * Global Variables
- *******************************************************************************)
-
- VAR
- gError: Integer; {Generic application error code}
- gWereInFront: Boolean; {TRUE if this appliation is front most}
- gQuitting: Boolean; {TRUE if user chose Quit command}
-
-
- (*******************************************************************************
- * DoQuit - Handle Quit command
- *
- * This routine is called when this application should quit. It’s called
- * when the user chooses the Quit command from the file menu or when a 'quit'
- * AppleEvent is received.
- *******************************************************************************)
-
- PROCEDURE DoQuit;
-
-
- (*******************************************************************************
- * ShowStopAlert - Show a stop alert
- *
- * This routine puts up a standard stop alert with just an OK button and a
- * specified message. messageClass specifies the STR# resource ID which contains
- * the message to display and messageIndex specifies the index (the first message
- * is index 1) into that STR# of the message to display.
- *******************************************************************************)
-
- FUNCTION ShowStopAlert (messageClass: Integer;
- messageIndex: Integer): Integer;
-
-
- (*******************************************************************************
- * ShowCautionOKCancelAlert - Show a caution alert with an OK and Cancel button
- *
- * This routine puts up a standard caution alert with just an OK button, a Cancel
- * button, and a specified message. messageClass specifies the STR# resource ID
- * which contains the message to display and messageIndex specifies the index
- * (the first message is index 1) into that STR# of the message to display.
- *******************************************************************************)
-
- FUNCTION ShowCautionOKCancelAlert (messageClass: Integer;
- messageIndex: Integer): Integer;
-
-
- (*******************************************************************************
- * ShowCautionOKAlert - Show a caution alert with just an OK button
- *
- * This routine puts up a standard caution alert with just an OK button and a
- * specified message. messageClass specifies the STR# resource ID which contains
- * the message to display and messageIndex specifies the index (the first message
- * is index 1) into that STR# of the message to display.
- *******************************************************************************)
-
- FUNCTION ShowCautionOKAlert (messageClass: Integer;
- messageIndex: Integer): Integer;
-
-
- (*******************************************************************************
- * ShowAboutBox - Show the About box
- *
- * The About box for this application is displayed. This is just a simple alert
- * box with an OK button. The name of this application is displayed as is its
- * version number.
- *******************************************************************************)
-
- PROCEDURE ShowAboutBox;
-
-
- (*******************************************************************************
- * CreateWindow - Create a window
- *
- * This routine creates a window using the WIND resource template with a resource
- * ID of windowTmplID in front of all existing windows. A pointer to this window
- * is returned. If we’re running on a Color QuickDraw machine, the window is
- * created as a color window. This window must be disposed of by calling
- * CloseWindow followed by DisposPtr on the window’s WindowRecord. The window
- * shouldn’t be closed using DisposeWindow. When this routine returns, the new
- * window is the current GrafPort.
- *
- * The window isn’t explicitly repositioned from its position as defined by the
- * resource definition. Instead, I use the window-positioning utilities. This
- * isn’t documented at this time and it isn’t even certain the these utilities
- * will be implemented in the final release of system software 7.0. Use ResEdit
- * 2.1’s WIND editor to control the window-positioning utilities.
- *
- * If there isn’t enough memory for the window, then gError global is set to
- * memFullErr. If the WIND resource couldn’t be loaded, gError is set to
- * resNotFound. If anything else went wrong while creating the window, then
- * gError is set to dsSysErr.
- *******************************************************************************)
-
- FUNCTION CreateWindow (windowTmplID: Integer): WindowPtr;
-
-
- (*******************************************************************************
- * CreateDialog - Create a dialog window
- *
- * This routine creates a dialog window using the WIND resource template with a
- * resource ID of windowTmplID in front of all existing windows. A pointer to
- * this window is returned. If we’re running on a Color QuickDraw machine, the
- * window is created as a color window. This window must be disposed of by
- * calling CloseWindow followed by DisposPtr on the window’s DialogRecord. The
- * window shouldn’t be closed using DisposeWindow. When this routine returns,
- * the new dialog is the current GrafPort.
- *
- * The window isn’t explicitly repositioned from its position as defined by the
- * resource definition. Instead, I use the window-positioning utilities. This
- * isn’t documented at this time and it isn’t even certain the these utilities
- * will be implemented in the final release of system software 7.0. Use ResEdit
- * 2.1’s WIND editor to control the window-positioning utilities.
- *
- * If there isn’t enough memory for the window, then gError global is set to
- * memFullErr. If the WIND resource couldn’t be loaded, gError is set to
- * resNotFound. If anything else went wrong while creating the window, then
- * gError is set to dsSysErr.
- *******************************************************************************)
-
- FUNCTION CreateDialog (dialogTmplID: Integer): DialogPtr;
-
-
- IMPLEMENTATION
-
- {$I UGlobals.inc1.p}
-
- END.
-